//
//  EFReturnTotalPriceCell.m
//  EnjogFood
//
//  Created by 王芳 on 17/6/11.
//  Copyright © 2017年 wf. All rights reserved.
//

#import "EFReturnTotalPriceCell.h"
#import "EFReturnTotalPriceItem.h"

@interface EFReturnTotalPriceCell ()
@property (strong, nonatomic) UILabel *priceLabel;
@end

@implementation EFReturnTotalPriceCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor whiteColor];
        [self initUI];
    }
    return self;
}

- (void)initUI{
    [self.contentView addSubview:self.priceLabel];
}

- (void)setObject:(EFReturnTotalPriceItem *)item{
    self.priceLabel.text = [NSString stringWithFormat:@"总价：%.2f",item.totalPrice.floatValue];
    [self.priceLabel sizeToFit];
    self.priceLabel.top = 10;
    self.priceLabel.right = kScreenWidth - 20;
    
}

- (UILabel *)priceLabel{
    if (!_priceLabel) {
        _priceLabel = [[UILabel alloc] init];
        _priceLabel.text = @"总价：";
        _priceLabel.font = [UIFont systemFontOfSize:13];
        _priceLabel.textColor = kBlack333;
    }
    return _priceLabel;
}

@end
